{% extends 'layout.html' %}
{% block main %}
<ol class="breadcrumb">
    <li><a href="/admin">管理首页</a></li>
    <li><span>内容编辑</span></li>
  </ol>
  <h3>内容编辑-{{con.title}}</h3>
  <form class="form" role="form" method="post">
    <div class="form-group">
        <label for="name">所属分类：</label>
        <select class="form-control" name="category" id="category" value="{{con.category._id}}">
            {% for cate in cateList %}
             {% if con.category._id.toString() == cate.id %}
             <option value="{{cate.id}}" selected>{{cate.name}}</option>
             {% else %}
             <option value="{{cate.id}}">{{cate.name}}</option>
             {% endif %}
            {% endfor %}
        </select>
      </div>
    <div class="form-group">
      <label for="title">内容标题</label>
      <input type="text" class="form-control" id="title" value="{{con.title}}" placeholder="请输入内容标题" name="title">
    </div>
    <div class="form-group">
        <label for="description">文章简介</label>
        <textarea type="text" class="form-control" id="description" placeholder="请输入内容简介" name="description">{{con.description}}</textarea>
      </div>
      <div class="form-group">
        <label for="content">文章内容</label>
        <textarea rows="4" type="text" class="form-control" id="content" placeholder="请输入文章内容" name="content">{{con.content}}</textarea>
      </div>
    <button type="submit" class="btn btn-primary btn-sm">Submit</button>
  </form>

{% endblock %}